#!/usr/bin/env python3
# coding:utf-8

import asyncio
import aiomqtt

async def main():
    async with aiomqtt.Client('127.0.0.1') as client:
        await client.publish('test/topic',payload=28.4)
        await client.publish('test/topic',payload='hello test'.encode())
        await client.publish('test/topic') # 无数据
if __name__ == '__main__':
    asyncio.run(main())